package com.briup.MR.DefinePartitioner;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;


public class PhonePartitioner extends Partitioner<Text,Text> {

    public int getPartition(Text text, Text text2, int i) {
        String phonenum = text.toString();
        if (phonenum.startsWith("138")){
            return 0;
        }else if (phonenum.startsWith("188")){
            return 1;
        }
        return 2;
    }
}
